home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_2
/
cal_v201
< prev
next >
Wrap
Internet Message Format
|
1995-03-31
|
23KB
From: Kevin Jessup <kevin.jessup@mixcom.mixcom.com>
Subject: v03i018: cal_v201 - Calendar v2.01, Part01/01
Newsgroups: comp.sources.hp48
Followup-To: comp.sys.hp48
Approved: spell@seq.uncwil.edu
Checksum: 3870485936 (verify with brik -cv)
Submitted-by: Kevin Jessup <kevin.jessup@mixcom.mixcom.com>
Posting-number: Volume 3, Issue 18
Archive-name: cal_v201/part01
BEGIN_RDME cal_v201.rdm
Just when you thought it was safe to go back on the net you find...
THE CALENDAR PROGRAM THAT WOULD NOT DIE!
***********************************************************************
* DOCUMENTATION FILE FOR HP48SX CALENDAR DRAWING FUNCTIONS *
* Version 2.01 *
* *
* by Kevin Jessup January 20th, 1992 *
***********************************************************************
These programs will draw a calendar on the display of the HP48 for any
month and year. Days that have an alarm due will be highlighted.
Revision History
----------------
Version 1.00
Originally appeared on the net in early 1990. It had a bug that
caused it to crash if no alarms were due after the date it was
processing.
Version 1.01
Claimed to fix the bug but did not.
Version 1.02
Worked, but was very slow.
Version 1.03
Was a bit faster.
Version 2.00
This version is a major rewrite of all the code. It is now fairly
well integrated into the existing HP48 alarm functions and executes
in 1/3 the time of the original! The original program ran by
building a GROB every step of the way. This version works entirely
in text mode before going to a GROB. At that point, the GROB is only
used for highlighting days that have an alarm due. It's also smaller
(by 383 bytes) than version 1.03.
Version 2.01
Version 2.00 required the display mode to be set to STD prior to
entry. Version 2.01 fixes the bug. Some of the code changed a bit
but it functions as in version 2.00. It's even a bit faster.
Other Calendar Programs
-----------------------
The idea for the single, long text string of 31 days was taken from the
program CALGEN9 by Eric B. Davis, Eddie Wilborne and Pete Wilson.
CALGEN9 is still the fastest freeware calendar maker I have seen for the
HP48. But, CALGEN9 does not display the alarms.
CALENDAR V2.0X not only displays the alarms, but provides a menu with hooks
into existing HP48 alarm functions. This version of CALENDAR also does
not care about the date mode (MM.DDYYYY or DD.MMYYYY), unlike CALGEN9.
SET EDITORIAL ON
By-the-way, would it not be nice if the 48 returned a date to the stack
in the format YYYYMMDDHH.fraction_of_hours regardless of mode? You could
then process any two dates and times using >, < or == without all the
messing around!
SET EDITORIAL OFF
END_RDME
BEGIN_DOC cal_v201.doc
Operation
---------
Transfer the ASC version or the commented ASCII source code to the HP48.
Recall the entire directory to the stack and run BYTES. Verify the
following...
Checksum: 64426 decimal
Byte count: 2637
Go to the calendar directory and press GO. The calendar for the current
month will be drawn. Days that have alarms due will be highlighted.
The following menu will then appear...
[MON-] [MON+] [ANY] [TODAY] [CAT] [DNAL]
Menu Key Function
-------- --------------------------------------------
MON- Move back a month.
MON+ Advance to the next month.
ANY Prompts for month and year.
Modify the month and year, then press ENTER.
The last drawn month is the default.
TODAY Draws a calendar for the current month.
CAT Activates the HP48 alarm catalog.
DNALM Displays the next due alarm
Press NXT to move to the next menu.
[SET] [PCAL] [ABOUT] [ ] [ ] [EXIT]
Menu Key Function
-------- -------------------------------------------------
SET Exits the application and places you in the
HP48 alarm-set menu.
PCAL Prints the calendar on the IR printer.
ABOUT A little message.
[ ] An unused key. Beeps.
[ ] An unused key. Beeps.
EXIT Leave the calendar application.
!WARNING!
---------
Certain functions make use of calls to internal HP48 system-RPL
routines. I have only tested this on a Rev E HP48.
I hope you like this version better than the original. This is
freeware. Of course, any donations are appreciated :-)))
Send flames to:
alt.null
Send suggestions, accolades and government grants to:
Kevin Jessup
9118 N 85th St.
Milwaukee, WI 53224
END_DOC
Here is the ASC-encoded CALENDAR directory.
BEGIN_ASC cal_v201.asc
%%HP: T(3)A(D)F(.);
"69A20FF7C4D0000000700594344537572670D9D20E1632634E147A20E4A20510
000000000000000000E4A20510000000000000000000B213047A20E4A2051000
2800000000000000E4A20510008300000000000000B2130C58C193632B2130CA
00070449435053414C470D9D20E163284E207005943445375726D85E13F2A24A
5A193632B2130A4000607454E43414C460D9D20E1632858A184E20703416C644
16475678BF184E20402544F475DBBF184E20304494D41C432D6E204046F67713
D6E20304696D6E1632C2A20F2000020202020202020202020202020202020202
02020247A20C2A2031000A416E657162797C2A20510006456262757162797C2A
20F0000D416273686C2A20F000014072796C6C2A20B0000D41697C2A20D0000A
457E656C2A20D0000A457C697C2A2011000145776573747C2A20710003556074
756D6265627C2A2031000F43647F6265627C2A2051000E4F66756D6265627C2A
205100044563656D6265627B213084E20703416C644164756D6BB16C7D1C2A20
700000276BA184E20703416C644164756339202000000000000010EEDA13ABB1
339204000000000000010EEDA176BA133920100000000000022092CF18B9C190
DA1ED2A250FA1D6BB19C2A276BA1DBBF1AE8C13CE22D6E204046F67713AFE22D
9D20C2A20920000202020202020202020202020202020202029C2A2D6E204046
F677133F2A2EEDA1C58C176BA1B21305DF22C2A20FB000020213020223020233
0202430202530202630202730202830202930213030213130213230213330213
4302135302136302137302138302139302230302231302232302233302234302
23530223630223730223830223930233030233139C2A2D6E20304696D63F2A2E
EDA1C58C176BA13CE2278BF18B9C1339202000000000008210EBBE1AFE22D9D2
078BF19C2A2339201000000000000120C58C1C2A20F200002355702D4F602455
702755602458602642702351676BA1DBBF133920100000000000022092CF18B9
C1C58C176BA1D13A2472C1B21305BF22D9D20D13A25D2C1B21305DF229C2A292
CF18B9C133920100000000000012050FA178BF1D6BB1DBBF13CE223ABB1AFE22
D9D209C2A276BA1B21305DF220A132D6E20109678BF1D6E20109633920100000
0000000120EEDA178BF133920100000000000002090DA1DBBF1C58C1D6E20109
6485A1C42328DBF1275E1634E1DCC0284E20703416C6441647563C032FD33284
991F1732D9D208DBF14B2A2B21305BF22D9D203CE2278BF1AFE22D9D20829919
C2A26C7D178BF178BF13ABB1339202000000000000010EEDA1D6BB1DBBF13CE2
278BF1D6BB184E20703416C644164756D6BB1279E1DBBF133920200000000000
0010EEDA13ABB184E20703416C644164756339202000000000000010EEDA13AB
B1279E1387E1AFE22D9D20D6E204046F6771376BA19C2A290DA178BF1743A2D4
EB1339201000000000000810EEDA1D13A276BA1B9691DBBF1743A250FA1D6BB1
3CE22D13A2313C1AFE22D9D209C2A276BA1B21305DF22C53A2EEDA1C53A276BA
1B9691ED2A2387C1634E1DBBF1E4A2051000D000000000000000E4A205100070
00000000000000614E1599A14E4E19C2A22D9919C2A2B21305BF22D9D203FBF1
4B2A2B21305DF22B21305DF22B21305DF22DE032F88E19B63284E20704494350
53414C4EF53293632B2130488009005255465D4F4E4458490D9D20E163278BF1
3CE22ED2A2EBBE1AFE22D9D203ABB133920100000000000021076BA133920499
000000000001090DA1B21305BF22D9D209C2A290DA1B21305DF2293632B21304
A00090E4548545D4F4E4458490D9D20E163278BF13CE22339201000000000000
210D5CE1AFE22D9D203ABB133920499000000000001076BA1B21305DF229C2A2
76BA193632B2130B8000304494D430D9D20E163278BF184E2090E4548545D4F4
E445842B99193632B213014000703416C6546514C470D9D20E1632916C11C432
D6E201066E1632684C13392010000000000002495D2C1EB3A1D6E201066F76C1
EF53293632B2130570006014C4D434144560D9D207EA74B2130F10005044E414
C4D450D9D202ED91B2130D1000402544F47540D9D2005EE0D20F0B969150FA1B
B691233A276BA1743A2D4EB1B213034000405485944540D9D20E1632606E147A
20634E184E20400505142584E20703416C644164756B2130EFE024B2A2691129
3632B2130760005045F444149550D9D20E1632C9432D9D20E163221891B0BC17
8BF1C2A2070000E24BAC1C2A20B0000E20313AE8C1B7FC14563284E20703416C
64416475697632DCC0284E20607454E43414C493632B213084E20703416C6546
514C493632B21301C0002074F420D9D20E163284E205045F444149547A2047A2
0C2A20D0000D4F4E4D2D9D20E1632C9432D9D20E163284E20703416C64416475
684E209005255465D4F4E445844563284E20703416C64416475697632DCC0284
E20607454E43414C493632B213084E20703416C6546514C493632B2130B21304
7A20C2A20D0000D4F4E4B2D9D20E1632C9432D9D20E163284E20703416C64416
475684E2090E4548545D4F4E445844563284E20703416C64416475697632DCC0
284E20607454E43414C493632B213084E20703416C6546514C493632B2130B21
3047A20C2A20B000014E495D9D20E1632C9432D9D20E1632C2A20F200054E647
562702D6F6E647860216E6460297561627E247A20B2130C2A2051000A3D4F6E6
4786A30284E20703416C644164756D6BB176BA1C2A2051000A0A395561627A30
276BA184E20703416C644164756339202000000000000010EEDA13ABB1339204
000000000000010EEDA176BA176BA147A209C2A2173A2B213076BA147A2084E2
01065B213076BA1AC422B7FC133920600000000000001050FA13392089900000
0000001076BA176BA14563284E20703416C64416475697632DCC0284E2060745
4E43414C493632B213084E20703416C6546514C493632B2130B213084E205045
F444149547A20C2A20B0000341445D9D20E1632C9432D9D20E163284E206014C
4D434144584E20607454E43414C493632B213084E20703416C6546514C493632
B2130B213047A20C2A20F000044E414C4D4D9D20E1632C9432D9D20E1632858A
184E205044E414C4D44B2A2F17A18DBF184E20607454E43414C493632B213084
E20703416C6546514C493632B2130B213047A20C2A20B0000355445D9D20E163
284E2040548594453392010000000000007306911293632B2130B213047A20C2
A20D0000053414C4D9D20E16324AEE184E20700594344537572635EE18DBF14A
EE14AEE14AEE193632B2130B213047A20C2A20F00001424F45545D9D20E16328
58A1C2A2092000020202023416C656E6461627026523E203139C2A2485A1C2A2
0D1000020202020202020202022697ED2A2485A1C2A20720000202020202B456
6796E602A456373757073F2A2485A1C2A20D20000202D496C6771657B6565602
8405438302242435D13A2485A1C2A209200002020202824313439202336323D2
23032303233A2485A1C2A2092000020202026305D40247F6027314D402343545
743A2485A13F2A24A5A193632B2130B213047A20B213047A20B213084E204054
859445B2130D511293632B2130AABF"
END_ASC
BYTES: #FBAAh 2644.5
BEGIN_UU cal_v201.uue
begin 644 cal_v201
M2%!(4#0X+466*O!_3`T````'4$E#5'-U8@>=+>!A(S;D0:<"3BI0`0``````M
M`````$XJ4`$````````````K,4"G`DXJ4`$`@@````````!.*E`!`#@`````R
M````*S'`A1PY-K(2`ZP`<$"4-`4U%,1TT-D"'C:"Y`('4$E#5'-U8HWE,2\JP
MI*618R,K,:`$``9'14Y#04P&G2W@82-8J('D`@=#86Q$871EA_N!Y`($4D1/0
M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`"`"`@("`H-#$T*2`S$
M-C(M,C`R,#*C0E@:+"J0`@`@("`@-E!-('1O(#=!32!#4U1'HT)8&O.B0EH:]
C.3:R$@,K,4"G`BLQ0*<"*S&`Y`($15A)5"LQT!4A.3:R$@.R/
``
end
END_UU
Here is the commented HP48 ASCII directory. You can download this
AS IS to your 48. Make sure you run the SETUP program (described
below) first!
BEGIN_RPL cal_v201
%%HP: T(3)A(D)F(.);
@ CALENDAR V2.01
@ ASCII directory listing with comments.
@ January 20th, 1992
@ by Kevin Jessup
@ Mark the beginning of the HP48 directory object.
DIR
@ Object name: SETUP
@ Object type: program
@ Purpose: Uses ASC-> to decode objects in this directory
@ that are ASC encoded. Then deletes itself.
@ Assumes you have the program ASC-> available
@ somewhere in the path to this directory!
@
@ Note: Before running SETUP, recall the entire
@ CALENDAR directory to the stack.
@ Execute BYTES and verify the following...
@ Checksum: 62694 decimal
@ Byte count: 2835
@
@ After running setup, verify the following...
@ Checksum: 64426 decimal
@ Byte count: 2637
SETUP
\<<
'ALMCAT' DUP RCL ASC\-> SWAP STO
'DNALM' DUP RCL ASC\-> SWAP STO
'RDOW' DUP RCL ASC\-> SWAP STO
'SETUP' PURGE
\>>
@ Object name: GO
@ Object type: program
@ Purpose: Main calendar routine entry point.
@
@ Press GO to start the calendar application.
@ GO enables all calendar functions via a
@ temporary menu. You cannot guarantee proper
@ operation of the CALENDAR functions unless you
@ run them via this menu interface! Most functions
@ call CalEVAL to guarantee flag settings and to
@ return the 48 flags to the state they were in prior
@ to running the function.
GO
\<<
TODAY
{
{
"MON-"
\<<
\<< CalDate PREVMONTH 'CalDate' STO GENCAL \>>
CalEVAL
\>>
}
{
"MON+"
\<<
\<< CalDate NEXTMONTH 'CalDate' STO GENCAL \>>
CalEVAL
\>>
}
{
"ANY"
\<< \<<
"Enter month and year." { } ":Month: " CalDate IP +
@ Do NOT remove the line-feed in the following text string!
"
:Year: " + CalDate 100 * FP 10000 * + + { 1 9 } + { V } +
INPUT OBJ\-> 1000000 / .01 + + 'CalDate'
STO GENCAL \>>
CalEVAL
\>>
}
TODAY
{
"CAT"
\<< \<< ALMCAT GENCAL \>>
CalEVAL \>>
}
{
"DNALM"
\<<
\<< CLLCD DNALM 0 WAIT DROP GENCAL \>>
CalEVAL \>>
}
{
"SET"
\<<
EXIT 37 MENU
\>>
}
{
"PCAL"
\<< CR PICTsub PR1 DROP CR CR CR \>>
}
{
"ABOUT"
\<<
CLLCD
" Calendar V2.01" 1 DISP
" by" 2 DISP
" Kevin Jessup" 3 DISP
" Milwaukee HP48 BBS" 5 DISP
" (414) 362-2020" 6 DISP
" 6PM to 7AM CST" 7 DISP
3 FREEZE
\>>
}
{}
{}
EXIT
}
TMENU
\>>
@ Object name: TODAY
@ Object type: program
@ Purpose: Get current date,
@ save in global variable
@ and draw the calendar.
TODAY
\<<
\<< DATE \->STR DUP "." POS ".01" REPL OBJ\-> 'CalDate' STO GENCAL \>>
CalEVAL
\>>
@ Object name: EXIT
@ Object type: program
@ Purpose: Purge global variables.
@ Return to text mode.
@ Display last menu prior to entry.
EXIT
\<<
TEXT { PICT PPAR CalDate } PURGE 0 MENU
\>>
@ Object name: RDOW
@ Object type: program
@ Purpose: Returns the day of week (0 = Sun, 6 = Sat)
@ of the date on level 1.
@ Warning: Uses SYSEVAL calls to
@ internal HP48 system RPL.
@ Note: As listed here, this is an ASC encoded string.
@ Use ASC-> to decode it before running!
RDOW
"D9D2005EE0D20F0B969150FA1BB691233A276BA1743A2D4EB1B21307B45"
@ Object name: DNALM
@ Object type: program
@ Purpose: Display next alarm.
@ Warning: Uses SYSEVAL calls to
@ internal HP48 system RPL.
@ Note: As listed here, this is an ASC encoded string.
@ Use ASC-> to decode it before running!
DNALM
"D9D202ED91B2130CD45"
@ Object name: ALMCAT
@ Object type: program
@ Purpose: Activate the alarm catalog.
@ Warning: Uses SYSEVAL calls to
@ internal HP48 system RPL.
@ Note: As listed here, this is an ASC encoded string.
@ Use ASC-> to decode it before running!
ALMCAT
"D9D207EA74B2130E98A"
@ Object name: CalEVAL
@ Object type: program
@ Purpose: Insures proper flag settings
@ required for all functions in
@ this package.
CalEVAL
\<< RCLF \-> f \<<
STD -42 CF EVAL f STOF \>>
\>>
@ Object name: DIM
@ Object type: program
@ Purpose: Returns the number of days in the month
@ for the date on stack level 1. Assumes
@ the following format: MM.01YYYY
DIM
\<<
DUP NEXTMONTH DDAYS
\>>
@ Object name: NEXTMONTH
@ Object type: program
@ Purpose: Returns the next month
@ for the date on stack level 1. Assumes
@ the following format: MM.01YYYY
NEXTMONTH
\<<
DUP
IF
12 >
THEN
FP .000001 +
END
1 +
\>>
@ Object name: PREVMONTH
@ Object type: program
@ Purpose: Returns the previous month
@ for the date on stack level 1. Assumes
@ the following format: MM.01YYYY
PREVMONTH
\<<
DUP
IF
2 <
THEN
FP 12 + .000001 -
ELSE
1 -
END
\>>
@ Object name: GENCAL
@ Object type: program
@ Purpose: Draw the calendar and alarms based
@ on the global CalDate variable.
GENCAL
\<<
CLLCD CalDate DUP RDOW SWAP DIM
\-> dow1 dim
\<<
" "
{
"January"
"February"
"March"
"April"
"May"
"June"
"July"
"August"
"September"
"October"
"November"
"December"
}
CalDate IP GET " " +
CalDate 100 * FP 10000 * +
22 OVER SIZE - 2 / IP 1 + SWAP REPL
IF
dow1
THEN
" " 1 dow1 3 * SUB +
END
" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31"
1 dim 3 * SUB +
IF
DUP SIZE 128 <
THEN
DUP 1 21 SUB " Su Mo Tu We Th Fr Sa"
+ SWAP 22 OVER SIZE SUB + 5 SF
ELSE
5 CF
END
1 OVER SIZE 21 / DUP IP SWAP
IF
FP
THEN
1 +
END
FOR i
DUP i 21 * DUP 20 - SWAP SUB i DISP
NEXT
DROP LCD\-> PICT STO CalDate
DO
IFERR
FINDALARM
THEN
DROP 0
ELSE
IF
DUP
THEN
RCLALARM 1 GET DUP DUP FP 100 * IP SWAP
IF
DUP IP CalDate IP == SWAP 100 * FP CalDate
100 * FP == AND
THEN
dow1 + 1 - DUP 7 MOD 18 * 5 + R\->B SWAP 7 / IP
IF
5 FS?
THEN
1 +
END
8 * 8 + R\->B 2 \->LIST PICT SWAP # 13d # 7d BLANK
NEG GXOR 1 DATE+ 1
ELSE
DROP2 0
END
END
END
UNTIL
NOT
END
DISPCAL
\>>
\>>
@ Object name: DISPCAL
@ Object type: program
@ Purpose: Get PICT and display it in the STACK area.
DISPCAL
\<<
PICTsub \->LCD 3 FREEZE
\>>
@ Object name: PICTsub
@ Object type: program
@ Purpose: Get only the portion of the
@ PICT GROB that we built.
PICTsub
\<<
PICT { # 0d # 0d } { # 130d # 56d } SUB
\>>
END
END_RPL
-- Kevin Jessup, bbwwbb@mixcom.mixcom.com